/* 基础变量和全局样式 */
:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #2ecc71;
    --gray-color: #95a5a6;
    --text-color: #333;
    --border-color: #ddd;
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 通用组件样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: linear-gradient(to right, #ff9966, #ff5e62);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单元素 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

/* 头部样式 */
.header {
    background-color: var(--dark-color);
    color: white;
    padding: 15px 0;
    box-shadow: var(--box-shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* 用户下拉菜单 */
.user-actions {
    display: flex;
    align-items: center;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.user-btn i {
    margin-right: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-radius: 4px;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* 认证页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.auth-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--dark-color);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

/* 电影列表 */
.movie-filters {
    padding: 20px 0;
    background-color: white;
    margin-bottom: 20px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
}

.filter-group label {
    margin-right: 10px;
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 150px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.movie-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.movie-poster {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

.movie-title {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

/* 电影详情 */
.movie-detail {
    padding: 30px 0;
}

.movie-header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.movie-poster img {
    width: 100%;
    border-radius: 8px;
}

.movie-info h1 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.movie-meta span {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.movie-meta i {
    margin-right: 5px;
    color: var(--primary-color);
}

.movie-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.movie-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
}

.movie-tabs {
    margin-top: 30px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--gray-color);
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-btn:hover:not(.active) {
    color: var(--dark-color);
}

.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--box-shadow);
}

.tab-content.active {
    display: block;
}

.movie-details {
    margin-top: 20px;
}

.detail-item {
    display: flex;
    margin-bottom: 10px;
}

.detail-label {
    font-weight: 500;
    min-width: 80px;
}

/* 排行榜 */
.rankings {
    padding: 30px 0;
}

.ranking-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-number {
    font-size: 18px;
    font-weight: bold;
    color: var(--gray-color);
    width: 40px;
    text-align: center;
}

.ranking-item.top-3 .ranking-number {
    color: var(--warning-color);
}

.ranking-item.top-1 .ranking-number {
    color: var(--danger-color);
    font-size: 24px;
}

.ranking-poster {
    width: 60px;
    height: 90px;
    margin-right: 15px;
}

.ranking-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.ranking-info {
    flex: 1;
}

.ranking-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.ranking-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--gray-color);
}

.ranking-rating {
    color: var(--warning-color);
    font-weight: bold;
}

/* 页脚 */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: 30px;
}

/* 搜索框 */
.search-section {
    background: #f5f5f5;
    padding: 2rem 0;
    text-align: center;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    width: 506px;
    padding: 0.8rem;
    border: none;
    outline: none;
}

.search-box button {
    padding: 0 1.5rem;
    background: #333;
    color: white;
    border: none;
    cursor: pointer;
}

/* 分类导航 */
.category-nav {
    padding: 1.5rem 0;
    text-align: center;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.category-item {
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
}

.category-item:hover {
    background: #333;
    color: white;
}

/* 电影卡片 */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.movie-card:hover {
    transform: translateY(-5px);
    user-focus: pointer;
}

.movie-card img {
    width: 100%;
    height: 100%;
}

.movie-card h3 {
    margin: 0.5rem;
    font-size: 1rem;
}

.movie-card p {
    margin: 0 0.5rem 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* VIP 标识 */
.movie-poster {
    position: relative;
    display: inline-block;
}

.movie-vip-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    background: linear-gradient(to right, #ff9966, #ff5e62);
}

.movie-vip-badge.free {
    background: linear-gradient(to right, #4facfe, #00f2fe);
}

/* 错误页面 */
.error-section {
    text-align: center;
    padding: 4rem 0;
}

.error-section h1 {
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 1rem;
}

.error-section p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.home-link {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.home-link:hover {
    background: #555;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.vip-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vip-option {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
}

.vip-option h3 {
    margin-bottom: 10px;
}

.vip-option p {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.vip-option .btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

.vip-option .btn:hover {
    background-color: #0056b3;
}



.cast-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.actor-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.actor-name {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1em;
}

.actor-nationality {
    margin: 0 0 12px 0;
    color: #666;
    font-style: italic;
}

.actor-birthday {
    margin: 0;
    color: #444;
    line-height: 1.6;
    font-size: 0.95em;
}

/* 剧情简介样式 */
#overview {
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

#movie-description {
    line-height: 1.8;
    color: #2d2d2d;
    font-size: 1.05em;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #4CAF50;
    border-radius: 0 8px 8px 0;
}

.movie-details {
    display: flex;  /* 修改为flex布局 */
    flex-direction: column;  /* 纵向排列 */
    gap: 15px;
    margin-top: 25px;
}

.detail-item {
    display: flex;
    flex-direction: column;  /* 纵向排列内部元素 */
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s;
}

.detail-item:hover {
    transform: translateX(5px);
}

.detail-label {
    color: #6c757d;
    font-weight: 500;
    margin-right: 0;  /* 移除右边距 */
    min-width: auto;  /* 移除最小宽度 */
    order: 1;  /* 调整标签顺序 */
}

.detail-item span:not(.detail-label) {
    order: 2;  /* 调整内容顺序 */
    color: #343a40;
    font-weight: 500;
    padding-left: 10px;
    position: relative;
}

.detail-item span:not(.detail-label)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 3px;
    height: 3px;
    background: #adb5bd;
    border-radius: 50%;
}

/* 评论区样式 */
#reviews {
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.comment-item:hover {
    background: #f1f3f5;
    transform: translateX(5px);
}

.user-id {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-weight: 500;
    margin-bottom: 8px;
}

.user-id::before {
    content: '';
    width: 28px;
    height: 28px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
}

.comment-time {
    color: #adb5bd;
    font-size: 0.9em;
    margin-left: auto;
}

.comment-content {
    line-height: 1.6;
    color: #343a40;
    margin-top: 10px;
    padding-left: 38px;
    position: relative;
}

.comment-content::before {
    content: "“";
    position: absolute;
    left: 15px;
    top: -5px;
    font-size: 2em;
    color: #4CAF50;
    opacity: 0.3;
    line-height: 0;
}

/* 评论表单样式 */
.comment-form {
    margin-top: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-control {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #4CAF50;
    outline: none;
}

.char-count {
    text-align: right;
    color: #868e96;
    font-size: 0.9em;
    margin-top: 5px;
    padding-right: 10px;
}


/* 登录提示样式 */
.login-prompt {
    padding: 20px;
    background: #fff3cd;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #ffc107;
}

.login-prompt p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .movie-details {
        grid-template-columns: 1fr;
    }

    .comment-item {
        flex-direction: column;
    }

    .comment-time {
        margin-left: 0;
        margin-top: 8px;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .main-nav li {
        margin-left: 0;
    }

    .movie-header {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
